package com.feige.weibo.apiservice;

import retrofit2.Retrofit;
import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;

/**
 * Created by Administrator on 2016/11/1.
 */

public class HttpUtil {
    /**
     * 懒汉单例模式
     */
     private static Retrofit retrofit = new Retrofit.Builder()
            .baseUrl(URL.BASE_URL)
            .addConverterFactory(GsonConverterFactory.create())
            .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
            .build();
     private static ApiServer apiServer = retrofit.create(ApiServer.class);

     public static ApiServer getSingletonInstance ()
     {
         return  apiServer;
     }


    //构造方法私有，不允许外部调用
    private HttpUtil()
    {}
}
